package cn.hiapi.shopkeeper.entity.activity;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.serializer.LongToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author AdinZ
 * @date 2022/12/16 21:58
 */
@Entity
@Table(name = "hiapi_shopkeeper_activity_category")
@ApiModel(description = "活动分类")
@Getter
@Setter
public class ActivityCategory extends BasicEntity {
    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake", strategy = "cn.hiapi.basic.id.SnowflakeId")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;

    @ApiModelProperty("上级分类")
    private long cid;
    @ApiModelProperty("缩略图")
    private String thumb;
    @ApiModelProperty("分类名字")
    private String name;
    @ApiModelProperty("分类介绍")
    private String body;
    @ApiModelProperty("状态,0隐藏,1显示")
    private int status = 1;

    @ApiModelProperty("排序")
    private int sort;

    @ApiModelProperty("创建时间")
    private long created = System.currentTimeMillis();

    @ApiModelProperty("更新时间")
    private long updated = System.currentTimeMillis();
}
